/**
 * Created by ma.jw on 2018/6/30.
 */
import moment from 'moment'

//输出格式为YYYY-MM-DD
let formatDate =(date)=>{
	return moment(date).format('YYYY-MM-DD')
};

//输出时间为几年前
let formatTime =(date)=>{
	moment.locale('zh-cn');//多语言转换
	return moment(date, "YYYYMMDD").fromNow();
}
export default {formatDate,formatTime}
